package com.common.project.service;

import com.common.project.dto.UserDTO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.common.project.table.User;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
 * <p>
 * 用户表 服务类
 * </p>
 *
 * @author jiangshicun
 * @since 2019-07-01
 */
@CacheConfig(cacheNames = "myCache")
public interface UserService extends IService<User> {

        /**
        * 导出Excel
        * @param response
        * @return
        */
        String outPutMode(HttpServletResponse response);

        /**
         *  导入Excel
         * @param file
         * @param request
         * @return
         */
        boolean inPutMode(MultipartFile file, HttpServletRequest request);



        /**
         * findByName
         * @param userName
         * @return
         */
        @Cacheable(key = "'loadUserByUsername:'+#p0")
        UserDTO findByName(String userName);
}
